package service.Impl;

import dao.CountryMapper;
import java.util.List;
import model.Country;
import model.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.CountryService;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/20 16:04
 * @description:
 */
@Service
public class CountryServiceImpl implements CountryService {
  @Autowired
  private CountryMapper countryMapper;

  @Override
  public List<Country> findAllCountry() {
    return countryMapper.findAllCountry();
  }

  @Override
  public int deleteByCode(String cname) {
    return countryMapper.deleteByCode(cname);
  }

  @Override
  public Country findByName(String cname) {
    return countryMapper.findByName(cname);
  }

  @Override
  public List<Country> searchCountryByName(String name) {
    return countryMapper.searchCountryByName(name);
  }

  @Override
  public int addCountry(Country country) {
    return countryMapper.addCountry(country);
  }

  @Override
  public int updataCountry(Country country) {
    return countryMapper.updateCountry(country);
  }

  @Override
  public List<Country> findAllByPage(int page, int pageSize) {
    return countryMapper.findAllByPage(page, pageSize);
  }
}
